<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<!--/* 加载IE8兼容性片段 */-->
<head>
    <title>问题工单</title>
    <!--/* 加载全局样式 */-->
    <th:block th:replace="common/thinDecorator::globalStyle"></th:block>
    <!--/* 加载全局主题样式 */-->
    <th:block th:replace="common/thinDecorator::globalThemeStyle"></th:block>
    <!--/* 加载全局布局样式 */-->
    <th:block th:replace="common/thinDecorator::globalLayoutStyle"></th:block>
</head>

<body class="page-content-white page-container-bg-solid" style="overflow-x: hidden;">
    <div class="page-wrapper">
        <!-- BEGIN CONTAINER -->
        <div class="page-container">
            <!-- BEGIN CONTENT -->
            <div class="page-content-wrapper">
                <!-- BEGIN CONTENT BODY -->
                <div class="page-content">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="portlet light" style="margin-bottom: 0px;">
                                <div class="portlet-title">
                                    <div class="caption font-blue">
                                        <i class="fa fa-table font-blue"></i>角色台账
                                    </div>
                                    <div class="actions">
                                        <a href="javascript:return false;" class="list-btn ">启用
                                        </a>
                                    </div>
                                </div>
                                <div class="portlet-body">
                                    <table id="table" style="width:100%;"></table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- END CONTENT BODY -->
            </div>
            <!-- END CONTENT -->
        </div>
    </div>
    <div id="scripts">
        <!--/* 加载IE8兼容性脚本 */-->
        <th:block th:replace="common/thinDecorator::IE8FixScripts"/>
        <!--/* 加载核心插件脚本 */-->
        <th:block th:replace="common/thinDecorator::corePluginsScripts"/>
        <!--/* 加载全局主题脚本 */-->
        <th:block th:replace="common/thinDecorator::globalThemeScripts"/>
        <!--/* 加载全局布局脚本 */-->
        <th:block th:replace="common/thinDecorator::globalLayoutScripts"/>
        <th:block th:replace="common/thinDecorator::globalsetupScripts"/>
        <script th:inline="javascript">
            $(function () {
                dataList.init();
            });
            var dataList = {
                easyuiTableInput: {},//记录查询框输入值
                //初始化
                init: function () {
                    this.easyuiTableInput = localStorageManage.get("table", "searchForm");
                    if (!this.easyuiTableInput) {
                        this.easyuiTableInput = {
                            searchData: {},
                            queryParams: {},
                        };
                    } else {
                        //写form表单查询
                    }
                    App.countHeight("table");
                    this.createDataGrid();
                },
                createDataGrid: function () {
                    $("#table").datagrid({
                        url: "/qa/biaozhun/pageIndex",
                        height: App.getPortletInnerHeight(),
                        queryParams: this.easyuiTableInput.queryParams,
                        frozenColumns: [
                            [
                                {field: 'checkbox', checkbox: true, align: "center", width: 35,},
                                {
                                    field: 'number',
                                    title: '序号',
                                    align: "center",
                                    width: 35,
                                    formatter: function (data, row, index) {
                                        return index + 1;
                                    }
                                },
                            ]
                        ],
                        columns: [
                            [

                                {
                                    "field": "cnName", title: "数据质量名称", width: 240, sortable: false,
                                    formatter: function (data, row, index) {
                                        return data;
                                    }
                                },
                                {
                                    "field": "syfw", title: "适用范围", width: 180, sortable: false,
                                    formatter: function (data, row, index) {
                                        return data;
                                    }
                                },
                                {
                                    "field": "sjzllx", title: "数据质量类型", width: 140, sortable: false,
                                    formatter: function (data, row, index) {
                                        return data;
                                    }
                                },
                                {
                                    "field": "createUser", title: "创建人", width: 140, sortable: false,
                                    formatter: function (data, row, index) {
                                        return data;
                                    }
                                },
                                {
                                    "field": "createTime", title: "创建时间", width: 140, sortable: false,
                                    formatter: function (data, row, index) {
                                        return data;
                                    }
                                },
                                {
                                    "field": "ckwx", title: "参考文献", width: 140, sortable: false,
                                    formatter: function (data, row, index) {
                                        return data;
                                    }
                                },
                                {
                                    "field": "sjzlbzml", title: "数据质量标准目录", width: 140, sortable: false,
                                    formatter: function (data, row, index) {
                                        return data;
                                    }
                                },
                                {
                                    "field": "fbzt", title: "发布状态", width: 140, sortable: false,
                                    formatter: function (data, row, index) {
                                        return data;
                                    }
                                }
                            ]
                        ],
                        fitColumns: false,//自适应
                        remoteFilter: true,
                        remoteSort: true,
                        clientPaging: false,
                        singleSelect: false,//单选
                        checkOnSelect: true,
                        striped: true, //表格设置为条纹
                        emptyMsg: "表中数据为空",
                        pagination: true,//分页
                        pagePosition: "bottom",
                        pageList: [20, 50, 100],
                        pageSize: 20,
                        automaticPolling: false,
                        onDblClickRow: function (rowIndex, row) {

                        }
                    });
                    this.createFilter();
                },
                //模糊查询
                createFilter: function () {
                    $('#table').datagrid('enableFilter', [
                        {"field": "number", type: 'label',},
                        {
                            "field": "cnName", type: 'textbox', options: {
                                value: dataList.easyuiTableInput.searchData.cnName,
                            }
                        },
                        {
                            "field": "syfw", type: 'textbox', options: {
                                value: dataList.easyuiTableInput.searchData.syfw,
                            }
                        },
                        {
                            "field": "sjzllx", type: 'textbox', options: {
                                value: dataList.easyuiTableInput.searchData.sjzllx,
                            }
                        },
                        {
                            "field": "createUser", type: 'textbox', options: {
                                value: dataList.easyuiTableInput.searchData.createUser,
                            }
                        },
                        {
                            "field": "createTime", type: 'textbox', options: {
                                value: dataList.easyuiTableInput.searchData.createTime,
                            }
                        },
                        {
                            "field": "ckwx", type: 'textbox', options: {
                                value: dataList.easyuiTableInput.searchData.ckwx,
                            }
                        },
                        {
                            "field": "sjzlbzml", type: 'textbox', options: {
                                value: dataList.easyuiTableInput.searchData.sjzlbzml,
                            }
                        },
                        {
                            "field": "fbzt", type: 'textbox', options: {
                                value: dataList.easyuiTableInput.searchData.fbzt,
                            }
                        },
                    ]);
                    // var searchBtn = '<a class="table-action" style="margin-left: 1px" onclick="App.search()">查询</a>';
                    // $('.datagrid-filter-row td[field="number"]').html(searchBtn);
                },
                edit: function () {
                    var row = $("#table").datagrid("getSelected");
                    if (0 !== row.stateId) {
                        $.messager.alert("该数据无法编辑", " ", "error");
                        return false;
                    }
                    $.messager.alert("该数据无法编辑", " ", "error");
                },
                back: function () {
                    $.messager.alert("该数据无法编辑", " ", "error");
                },
            };
        </script>
    </div>
    <!-- END CONTAINER -->
</body>

</html>